package www.reagnetbox.com.scan;

/**
 * usb设备，包括点对点和usb芯片方式。
 * Created by lgz on 17-4-27.
 */

//usb设备描述
public class UsbCommDev extends CommType {
	private String mProcId;
	private String mVendorId;
	private String mInterfaceClass;
	private String mInterfaceSubclass;
	private String mInterfaceProtocol;
	private int baudrate = 115200; //有些usb转串口需要该参数

	public String getProcId() {
		return mProcId;
	}

	public String getVendorId() {
		return mVendorId;
	}

	public String getInterfaceClass() {
		return mInterfaceClass;
	}

	public String getInterfaceSubclass() {
		return mInterfaceSubclass;
	}

	public String getInterfaceProtocol() {
		return mInterfaceProtocol;
	}

	//修改设备描述
	public void setDescript(CommTypeDescript desc) {
		mDescript = desc;
	}

	public void setBaudrate(int baudrate) {
		this.baudrate = baudrate;
	}

	public int getBaudrate() {
		return baudrate;
	}

	//修改设备参数
	public void setDev(String procId, String vendorId, String interfaceClass,
                       String interfaceSubclass, String interfaceProtocol) {
		mProcId = procId;
		mVendorId = vendorId;
		mInterfaceClass = interfaceClass;
		mInterfaceSubclass = interfaceSubclass;
		mInterfaceProtocol = interfaceProtocol;
	}

	public UsbCommDev(String procId, String vendorId, String interfaceClass,
                      String interfaceSubclass, String interfaceProtocol) {
		super(CommTypeDescript.USB_PL2303);
		setDev(procId, vendorId, interfaceClass,
				interfaceSubclass, interfaceProtocol);
	}
}
